<template>
  <div>
    <el-table  :data="list" fit highlight-current-row style="width: 100%">
      <el-table-column
        label="序号"
        type="index"
        style="width: 8%"
        align="center">
      </el-table-column>
      <el-table-column style="width: 12%" align="center" label="姓名">
        <template slot-scope="scope">
          <span>{{ scope.row.name }}</span>
        </template>
      </el-table-column>

      <el-table-column style="width: 12%" align="center" label="年龄">
        <template slot-scope="scope">
          <span>{{ scope.row.age }}</span>
        </template>
      </el-table-column>
      
      <el-table-column style="width: 12%" align="center" label="所授课程">
        <template slot-scope="scope">
          <span>{{ scope.row.type }}</span>
        </template>
      </el-table-column>
      <el-table-column  style="width: 12%" align="center" label="提交时间">
        <template slot-scope="scope">
          <span>{{ scope.row.tjsj }}</span>
        </template>
      </el-table-column>
      <el-table-column v-if="isShow !== 'D'" style="width: 12%" align="center" label="审批人">
        <template slot-scope="scope">
          <span>{{ scope.row.spr }}</span>
        </template>
      </el-table-column>
      <el-table-column v-if="isShow !== 'D'" style="width: 12%" align="center" label="审批时间">
        <template slot-scope="scope">
          <span>{{ scope.row.spsj }}</span>
        </template>
      </el-table-column>

      <!--<el-table-column v-if="isShow !== 'D'" style="width: 12%" align="center" label="提交时间">-->
        <!--<template slot-scope="scope">-->
          <!--<span>{{ scope.row.tjsj }}</span>-->
        <!--</template>-->
      <!--</el-table-column>-->
      <!--<el-table-column v-if="isShow !== 'D'" style="width: 12%" align="center" label="审批时间">-->
        <!--<template slot-scope="scope">-->
          <!--<span>{{ scope.row.spsj }}</span>-->
        <!--</template>-->
      <!--</el-table-column>-->
      <el-table-column style="width: 12%" align="center" label="操作">
        <template slot-scope="scope">
          <el-button v-if="isShow === 'W'" type="text" @click="open">原因</el-button>
          <i v-if="isShow === 'W'">|</i>
          <el-button type="text"  @click="$router.push({ name: 'trusteeship-particulars', params: {id:isShow} })">详情</el-button>
        </template>
      </el-table-column>
    </el-table>
    <el-pagination class="pagination-a" background layout="prev, pager, next" :total="10">
    </el-pagination>
  </div>
</template>

<script>
  export default {

    filters: {
      statusFilter(status) {
        const statusMap = {
          published: 'success',
          draft: 'info',
          deleted: 'danger'
        }
        return statusMap[status]
      }
    },
    props: {
      type: {
        type: String,
        default: 'D'
      }
    },
    data() {
      return {
        list: null,
        isShow:'D',
        listQuery: {
          page: 1,
          limit: 5,
          type: this.type,
          sort: '+id'
        },
      }
    },
    created() {
      this.getList()
    },
    methods: {
      getList() {
        this.loading = true
        this.isShow = this.listQuery.type

          this.list = [
            { name: '徐小溢',  age: '32',type:'数学',identity:'410924187348293402',tjsj:'2021-09-01 10:00',spr:'李七七',spsj:'2021-09-07 10:00' },
            { name: '方子阳',  age: '32',type:'数学',identity:'410924187348293402',tjsj:'2021-09-01 10:00',spr:'李七七',spsj:'2021-09-07 10:00' },
            { name: '洛乡田',  age: '23',type:'数学',identity:'410924187348293402',tjsj:'2021-09-01 10:00',spr:'李七七',spsj:'2021-09-07 10:00' },
            { name: '李勇',  age: '22',type:'数学',identity:'410924187348293402',tjsj:'2021-09-01 10:00',spr:'李七七',spsj:'2021-09-07 10:00' },
            { name: '王伟',  age: '33',type:'数学',identity:'410924187348293402',tjsj:'2021-09-01 10:00',spr:'李七七',spsj:'2021-09-07 10:00' },
            { name: '徐小溢',  age: '31',type:'数学',identity:'410924187348293402',tjsj:'2021-09-01 10:00',spr:'李七七',spsj:'2021-09-07 10:00' },
            { name: '洛乡田',  age: '23',type:'数学',identity:'410924187348293402',tjsj:'2021-09-01 10:00',spr:'李七七',spsj:'2021-09-07 10:00' },
            { name: '王伟',  age: '21',type:'数学',identity:'410924187348293402',tjsj:'2021-09-01 10:00',spr:'李七七',spsj:'2021-09-07 10:00' },
            { name: '徐小溢',  age: '31',type:'数学',identity:'410924187348293402',tjsj:'2021-09-01 10:00',spr:'李七七',spsj:'2021-09-07 10:00' },
            { name: '王伟',  age: '41',type:'数学',identity:'410924187348293402',tjsj:'2021-09-01 10:00',spr:'李七七',spsj:'2021-09-07 10:00' }
          ]



      },
      open() {
        this.$alert('<strong>机构内容从法理基础来讲，教育培训机构享有的权利属于社会教育权，其存在具有一定的法理基础，教育培训机构在民法中是“特殊企业法人”，其公益属性是不同于一般企业法人最显著的特征；在行政法中是“行政相对人”，与政府构成行政法律关系。归属于社会教育权范畴的教育培训机构，相对于国家教育权而言，具有独特的法律属性。</strong>', '未通过原因', {
          dangerouslyUseHTMLString: true
        });
      },
    }
  }
</script>

